package cn.lkp.mall.member.config;
import cn.lkp.mall.member.interceptor.LoginUserInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 将拦截器加入web配置
 */
@Configuration
public class MemberWebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //拦截所有订单请求
        registry.addInterceptor(new LoginUserInterceptor()).addPathPatterns("/**");
    }
}
